package com.itheima.Demo01.demo01;

import java.net.InetAddress;
import java.net.UnknownHostException;

public class Network {
    public static void main(String[] args) throws UnknownHostException {
        InetAddress name = InetAddress.getByName("爷青结");
        String hostName = name.getHostName();
        System.out.println("主机名"+hostName);

        String hostAddress = name.getHostAddress();
        System.out.println("IP"+hostAddress);

    }
}
